﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Com.BU;

namespace Com
{
    /// <summary>
    /// Interaction logic for TemplateManager.xaml
    /// </summary>
    public partial class TemplateManager : Window
    {
        LibraryManagerInCom lbrManager = new LibraryManagerInCom();
        public TemplateManager()
        {
            InitializeComponent();
            Loadlocation();
            Loadroof();
            LoadCeiling();
            LoadWall();
        }
        //  Load thông số địa điểm
        private void Loadlocation()
        {
            cbxLocation.ItemsSource = null;
            cbxLocation.Items.Clear();
            LibraryManagerInCom.loadLocation();
            cbxLocation.ItemsSource = LibraryManagerInCom.LocationList;
            cbxLocation.DisplayMemberPath = "location";
            cbxLocation.SelectedIndex = 0;
        }
        // Load Thông số của trần 
        private void LoadCeiling()
        {
            //  Load thông số độ dày của trần
            cbxThickness.ItemsSource = null;
            cbxThickness.Items.Clear();
            LibraryManagerInCom.loadCeiling();
            cbxThickness.ItemsSource = LibraryManagerInCom.CeilingList;
            cbxThickness.DisplayMemberPath = "description";
            cbxThickness.SelectedIndex = 0;
            // Load thống số loại khung 

        }
        // Load thông số tường
        private void LoadWall()
        {
            cbxMaterial1.ItemsSource = null;
            cbxMaterial1.Items.Clear();
            LibraryManagerInCom.loadCSWallMaterialList();
            cbxMaterial1.ItemsSource = LibraryManagerInCom.CSWallMaterialList;
            cbxMaterial1.DisplayMemberPath = "wall_type";
            cbxMaterial1.SelectedIndex = 0;
            //  Load Expousure
            //cbxExposure.ItemsSource = null;
           // cbxExposure.Items.Clear();
            // LibraryManagerInCom.

        }
        // Load roof
        private void Loadroof()
        {
            cbxSurface.ItemsSource = null;
            cbxSurface.Items.Clear();
            LibraryManagerInCom.loadSurfaceCoefficient();
            cbxSurface.ItemsSource = LibraryManagerInCom.RoofSurfaceList;
            cbxSurface.DisplayMemberPath = "surface_roof";
            cbxSurface.SelectedIndex = 0;
            //
            //  Loại mái 
            cbxTypeRoof.ItemsSource = null;
            cbxTypeRoof.Items.Clear();
            LibraryManagerInCom.loadRoofCeilingCharacteristic();
            cbxTypeRoof.ItemsSource = LibraryManagerInCom.RoofCeilingCharacteristicList;
            cbxTypeRoof.DisplayMemberPath = "roof_ceiling_characteristic";
            cbxTypeRoof.SelectedIndex = 0;

        }
        //  Nền 
        private void LoadBackground()
        {
            
        }
       //  
       //   cbxCharac
       //   cbxStructure
           
       //  Glass
        private void LoadGlass()
        {
           //   Loai kinh
            cbxType.ItemsSource=null;
            cbxType.Items.Clear();
            LibraryManagerInCom.loadGlassList();
            cbxType.ItemsSource=LibraryManagerInCom.GlassCoeffientList;
            cbxType.DisplayMemberPath="glass_type";
            cbxType.SelectedIndex=0;
            //  Direction 
            cbxDirection.ItemsSource=null;;
            cbxDirection.Items.Clear();
            cbxDirection.ItemsSource=LibraryManagerInCom.GlassCoeffientList;;
            cbxDirection.DisplayMemberPath="glass_direction";
             cbxType.SelectedIndex=0;
            //
            cbxHeat.ItemsSource=null;;
            cbxHeat.Items.Clear();
            LibraryManagerInCom.loadSolarRadiation();
            cbxHeat.ItemsSource=LibraryManagerInCom.SolarRadiationList;
            cbxHeat.DisplayMemberPath="radiation_amount";
            cbxHeat.SelectedIndex=0;
             // cbxLocation1;
            //cbxPressure
        }
        
      
   
        private void btnDelete3_Click(object sender, RoutedEventArgs e)
        {
           // Template.listCon.Remove((Construction)cbxAlternative3.SelectedItem);
        }

        private void cbxLocation_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }
    }
}
